package com.atguigu.tingshu.order.pattern.factory;

import com.atguigu.tingshu.order.pattern.TradeStrategy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author: atguigu
 * @create: 2025-06-17 09:34
 */
@Component
public class TradeStrategyFactory {

    @Autowired
    private Map<String, TradeStrategy> strategyMap;

    public TradeStrategy getStrategy(String orderItemType) {
        return strategyMap.get(orderItemType);
    }
}
